package com.company.emallbackend.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;

/**
* <p>
* 
* </p>
*
* @author hanlijian
* @since 2023-01-12
*/
@Getter
@Setter
@TableName("t_star")
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "Star对象", description = "")
public class Star implements Serializable {

private static final long serialVersionUID = 1L;

    // 主键id
    @ApiModelProperty("主键id")
    @Alias("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    // 关联user表id
    @ApiModelProperty("关联user表id")
    @Alias("关联user表id")
    private Integer userId;

    // 关联product表id
    @ApiModelProperty("关联product表id")
    @Alias("关联product表id")
    private Integer productId;

    // 创建时间
    @ApiModelProperty("创建时间")
    @Alias("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    // 修改时间
    @ApiModelProperty("修改时间")
    @Alias("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    // 逻辑删除(0:未删除  1:已删除)
    @ApiModelProperty("逻辑删除(0:未删除  1:已删除)")
    @Alias("逻辑删除(0:未删除  1:已删除)")
    @TableLogic
    private Integer isDelete;

    public Star(Integer userId, Integer productId) {
        this.userId = userId;
        this.productId = productId;
    }
}